home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / SOURCE.ZIP / ROOT.ASM < prev    next >
Assembly Source File  |  1992-08-30  |  6KB  |  250 lines

  1.  
  2. PAGE  59,132
  3.  
  4. ;██████████████████████████████████████████████████████████████████████████
  5. ;██                                         ██
  6. ;██                    ROOT                         ██
  7. ;██                                         ██
  8. ;██      Created:   30-Aug-92                             ██
  9. ;██      Passes:    5           Analysis Options on: none             ██
  10. ;██                                         ██
  11. ;██████████████████████████████████████████████████████████████████████████
  12.  
  13. data_0001e    equ    78h
  14. data_0002e    equ    7C0Bh            ;*
  15. data_0003e    equ    7C0Dh            ;*
  16. data_0004e    equ    7C0Eh            ;*
  17. data_0005e    equ    7C10h            ;*
  18. data_0006e    equ    7C11h            ;*
  19. data_0007e    equ    7C13h            ;*
  20. data_0008e    equ    7C15h            ;*
  21. data_0009e    equ    7C16h            ;*
  22. data_0010e    equ    7C18h            ;*
  23. data_0011e    equ    7C1Ah            ;*
  24. data_0012e    equ    7C1Ch            ;*
  25. data_0013e    equ    7C1Eh            ;*
  26. data_0014e    equ    7C20h            ;*
  27. data_0015e    equ    7C24h            ;*
  28. data_0016e    equ    7C25h            ;*
  29. data_0017e    equ    7C3Eh            ;*
  30. data_0018e    equ    7C49h            ;*
  31. data_0019e    equ    7C4Bh            ;*
  32. data_0020e    equ    7C4Dh            ;*
  33. data_0021e    equ    7C4Fh            ;*
  34. data_0022e    equ    7C50h            ;*
  35. data_0023e    equ    7C52h            ;*
  36. data_0024e    equ    7D9Eh            ;*
  37. data_0025e    equ    7DE6h            ;*
  38.  
  39. seg_a        segment    byte public
  40.         assume    cs:seg_a, ds:seg_a
  41.  
  42.  
  43.         org    100h
  44.  
  45. root        proc    far
  46.  
  47. start:
  48.         jmp    short loc_0002
  49.         db    90h
  50.         db    'MSDOS5.0'
  51.         db     00h, 02h, 04h, 01h, 00h, 02h
  52.         db     00h, 02h,0FEh,0EFh,0F8h, 3Ch
  53.         db     00h, 11h, 00h, 0Fh, 00h, 11h
  54.         db    7 dup (0)
  55.         db     80h, 00h, 29h, 27h, 45h, 08h
  56.         db     19h
  57.         db    'MS-DOS_5   FAT16   '
  58. loc_0002:
  59.         cli                ; Disable interrupts
  60.         xor    ax,ax            ; Zero register
  61.         mov    ss,ax
  62.         mov    sp,7C00h
  63.         push    ss
  64.         pop    es
  65.         mov    bx,data_0001e
  66.         lds    si,dword ptr ss:[bx]    ; Load 32 bit ptr
  67.         push    ds
  68.         push    si
  69.         push    ss
  70.         push    bx
  71.         mov    di,data_0017e
  72.         mov    cx,0Bh
  73.         cld                ; Clear direction
  74.         rep    movsb            ; Rep when cx >0 Mov [si] to es:[di]
  75.         push    es
  76.         pop    ds
  77.         mov    byte ptr [di-2],0Fh
  78.         mov    cx,ds:data_0010e
  79.         mov    [di-7],cl
  80.         mov    [bx+2],ax
  81.         mov    word ptr [bx],7C3Eh
  82.         sti                ; Enable interrupts
  83.         int    13h            ; Disk  dl=drive a  ah=func 00h
  84.                         ;  reset disk, al=return status
  85.         jc    loc_0004        ; Jump if carry Set
  86.         xor    ax,ax            ; Zero register
  87.         cmp    ds:data_0007e,ax
  88.         je    loc_0003        ; Jump if equal
  89.         mov    cx,ds:data_0007e
  90.         mov    ds:data_0014e,cx
  91. loc_0003:
  92.         mov    al,ds:data_0005e
  93.         mul    word ptr ds:data_0009e    ; ax = data * ax
  94.         add    ax,ds:data_0012e
  95.         adc    dx,ds:data_0013e
  96.         add    ax,ds:data_0004e
  97.         adc    dx,0
  98.         mov    ds:data_0022e,ax
  99.         mov    ds:data_0023e,dx
  100.         mov    ds:data_0018e,ax
  101.         mov    ds:data_0019e,dx
  102.         mov    ax,20h
  103.         mul    word ptr ds:data_0006e    ; ax = data * ax
  104.         mov    bx,ds:data_0002e
  105.         add    ax,bx
  106.         dec    ax
  107.         div    bx            ; ax,dx rem=dx:ax/reg
  108.         add    ds:data_0018e,ax
  109.         adc    word ptr ds:data_0019e,0
  110.         mov    bx,500h
  111.         mov    dx,ds:data_0023e
  112.         mov    ax,ds:data_0022e
  113.         call    sub_0002
  114.         jc    loc_0004        ; Jump if carry Set
  115.         mov    al,1
  116.         call    sub_0003
  117.         jc    loc_0004        ; Jump if carry Set
  118.         mov    di,bx
  119.         mov    cx,0Bh
  120.         mov    si,data_0025e
  121.         repe    cmpsb            ; Rep zf=1+cx >0 Cmp [si] to es:[di]
  122.         jnz    loc_0004        ; Jump if not zero
  123.         lea    di,[bx+20h]        ; Load effective addr
  124.         mov    cx,0Bh
  125.         repe    cmpsb            ; Rep zf=1+cx >0 Cmp [si] to es:[di]
  126.         jz    loc_0006        ; Jump if zero
  127. loc_0004:
  128.         mov    si,data_0024e
  129.         call    sub_0001
  130.         xor    ax,ax            ; Zero register
  131.         int    16h            ; Keyboard i/o  ah=function 00h
  132.                         ;  get keybd char in al, ah=scan
  133.         pop    si
  134.         pop    ds
  135.         pop    word ptr [si]
  136.         pop    word ptr [si+2]
  137.         int    19h            ; Bootstrap loader
  138. loc_0005:
  139.         pop    ax
  140.         pop    ax
  141.         pop    ax
  142.         jmp    short loc_0004
  143. loc_0006:
  144.         mov    ax,[bx+1Ah]
  145.         dec    ax
  146.         dec    ax
  147.         mov    bl,ds:data_0003e
  148.         xor    bh,bh            ; Zero register
  149.         mul    bx            ; dx:ax = reg * ax
  150.         add    ax,ds:data_0018e
  151.         adc    dx,ds:data_0019e
  152.         mov    bx,700h
  153.         mov    cx,3
  154.  
  155. locloop_0007:
  156.         push    ax
  157.         push    dx
  158.         push    cx
  159.         call    sub_0002
  160.         jc    loc_0005        ; Jump if carry Set
  161.         mov    al,1
  162.         call    sub_0003
  163.         pop    cx
  164.         pop    dx
  165.         pop    ax
  166.         jc    loc_0004        ; Jump if carry Set
  167.         add    ax,1
  168.         adc    dx,0
  169.         add    bx,ds:data_0002e
  170.         loop    locloop_0007        ; Loop if cx > 0
  171.  
  172.         mov    ch,ds:data_0008e
  173.         mov    dl,ds:data_0015e
  174.         mov    bx,ds:data_0018e
  175.         mov    ax,ds:data_0019e
  176. ;*        jmp    far ptr loc_0001    ;*
  177.         db    0EAh, 00h, 00h, 70h, 00h
  178.  
  179. root        endp
  180.  
  181. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  182. ;                   SUBROUTINE
  183. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  184.  
  185. sub_0001    proc    near
  186. loc_0008:
  187.         lodsb                ; String [si] to al
  188.         or    al,al            ; Zero ?
  189.         jz    loc_ret_0010        ; Jump if zero
  190.         mov    ah,0Eh
  191.         mov    bx,7
  192.         int    10h            ; Video display   ah=functn 0Eh
  193.                         ;  write char al, teletype mode
  194.         jmp    short loc_0008
  195.  
  196. ;▀▀▀▀ External Entry into Subroutine ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  197.  
  198. sub_0002:
  199.         cmp    dx,ds:data_0010e
  200.         jae    loc_0009        ; Jump if above or =
  201.         div    word ptr ds:data_0010e    ; ax,dxrem=dx:ax/data
  202.         inc    dl
  203.         mov    ds:data_0021e,dl
  204.         xor    dx,dx            ; Zero register
  205.         div    word ptr ds:data_0011e    ; ax,dxrem=dx:ax/data
  206.         mov    ds:data_0016e,dl
  207.         mov    ds:data_0020e,ax
  208.         clc                ; Clear carry flag
  209.         retn
  210. loc_0009:
  211.         stc                ; Set carry flag
  212.  
  213. loc_ret_0010:
  214.         retn
  215. sub_0001    endp
  216.  
  217.  
  218. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  219. ;                   SUBROUTINE
  220. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  221.  
  222. sub_0003    proc    near
  223.         mov    ah,2
  224.         mov    dx,ds:data_0020e
  225.         mov    cl,6
  226.         shl    dh,cl            ; Shift w/zeros fill
  227.         or    dh,ds:data_0021e
  228.         mov    cx,dx
  229.         xchg    ch,cl
  230.         mov    dl,ds:data_0015e
  231.         mov    dh,ds:data_0016e
  232.         int    13h            ; Disk  dl=drive ?  ah=func 02h
  233.                         ;  read sectors to memory es:bx
  234.                         ;   al=#,ch=cyl,cl=sectr,dh=head
  235.         retn
  236. sub_0003    endp
  237.  
  238.         db    0Dh, 0Ah, 'Non-System disk or dis'
  239.         db    'k error', 0Dh, 0Ah, 'Replace and'
  240.         db    ' press any key when ready', 0Dh, 0Ah
  241.         db    0
  242.         db    'IO      SYSMSDOS   SYS'
  243.         db     00h, 00h, 55h,0AAh
  244.  
  245. seg_a        ends
  246.  
  247.  
  248.  
  249.         end    start
  250.